package apiroutes

import (
	"dataaysn/internal/service"

	"github.com/gin-gonic/gin"
)

func RegisterHospitalizationRoutes(r *gin.Engine, hospitalizationService *service.HospitalizationDetailService) {
	hospGroup := r.Group("/api/hospitalizations")
	{
		hospGroup.POST("", hospitalizationService.CreateDetail)
		hospGroup.GET("", hospitalizationService.ListDetailsByDateRange)
		hospGroup.GET("/:id", hospitalizationService.GetDetailByID)
		hospGroup.GET("/patient/:patientID", hospitalizationService.ListDetailsByInpatient)
		// 由于 updateDetail 是未导出方法，需要调用其导出版本（假设导出方法名为 UpdateDetail）
		hospGroup.PUT("/:id", hospitalizationService.UpdateDetail)
		hospGroup.DELETE("/:id", hospitalizationService.Delete)
	}
}
